{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 230,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "PyRosetta-4 2020 [Rosetta PyRosetta4.conda.mac.python37.Release 2020.02+release.22ef835b4a2647af94fcd6421a85720f07eddf12 2020-01-05T17:31:56] retrieved from: http://www.pyrosetta.org\n",
      "(C) Copyright Rosetta Commons Member Institutions. Created in JHU by Sergey Lyskov and PyRosetta Team.\n",
      "\u001b[0mcore.init: {0} \u001b[0mChecking for fconfig files in pwd and ./rosetta/flags\n",
      "\u001b[0mcore.init: {0} \u001b[0mRosetta version: PyRosetta4.conda.mac.python37.Release r242 2020.02+release.22ef835b4a2 22ef835b4a2647af94fcd6421a85720f07eddf12 http://www.pyrosetta.org 2020-01-05T17:31:56\n",
      "\u001b[0mcore.init: {0} \u001b[0mcommand: PyRosetta -ex1 -ex2aro -database /Users/sujiaqi/miniconda3/envs/py3/lib/python3.7/site-packages/pyrosetta/database\n",
      "\u001b[0mbasic.random.init_random_generator: {0} \u001b[0m'RNG device' seed mode, using '/dev/urandom', seed=1807194022 seed_offset=0 real_seed=1807194022 thread_index=0\n",
      "\u001b[0mbasic.random.init_random_generator: {0} \u001b[0mRandomGenerator:init: Normal mode, seed=1807194022 RG_type=mt19937\n"
     ]
    }
   ],
   "source": [
    "import pyrosetta \n",
    "from pyrosetta import *\n",
    "init()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 231,
   "metadata": {},
   "outputs": [],
   "source": [
    "#pose，from sequence 'AAAAAAAAA'\n",
    "pose = pose_from_sequence('A'*10)\n",
    "test_pose=pose"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 232,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyrosetta import PyMOLMover\n",
    "#pymol show\n",
    "pmm = PyMOLMover()\n",
    "pmm.apply(pose)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 219,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 219,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(pose.sequence())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 233,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Residue 5: ALA (ALA, A):\n",
      "Base: ALA\n",
      " Properties: POLYMER PROTEIN CANONICAL_AA ALIPHATIC METALBINDING ALPHA_AA L_AA\n",
      " Variant types:\n",
      " Main-chain atoms:  N    CA   C  \n",
      " Backbone atoms:    N    CA   C    O    H    HA \n",
      " Side-chain atoms:  CB  1HB  2HB  3HB \n",
      "Atom Coordinates:\n",
      "   N  : 12.404, 7.64594, 3.32143e-16\n",
      "   CA : 13.862, 7.64594, 1.28484e-15\n",
      "   C  : 14.4129, 9.06611, 1.39319e-16\n",
      "   O  : 13.655, 10.0362, -1.38422e-15\n",
      "   CB : 14.3918, 6.87318, -1.19909\n",
      "   H  : 11.9121, 8.52802, -3.16607e-16\n",
      "   HA : 14.2007, 7.15631, 0.91315\n",
      "  1HB : 15.4817, 6.88219, -1.18511\n",
      "  2HB : 14.0369, 5.8435, -1.15412\n",
      "  3HB : 14.0373, 7.33896, -2.11716\n",
      "Mirrored relative to coordinates in ResidueType: FALSE\n",
      "\n"
     ]
    }
   ],
   "source": [
    "#第五个AA信息\n",
    "print(pose.residue(5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 234,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[0mcore.scoring.ScoreFunctionFactory: {0} \u001b[0mSCOREFUNCTION: \u001b[32mcen_std\u001b[0m\n"
     ]
    }
   ],
   "source": [
    "#score(0)\n",
    "scr=get_score_function(0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 223,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20.3253531"
      ]
     },
     "execution_count": 223,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#打分\n",
    "scr(test_pose)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 235,
   "metadata": {},
   "outputs": [],
   "source": [
    "#忽略侧链，侧链质心\n",
    "switch = SwitchResidueTypeSetMover(\"centroid\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 236,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Residue 5: ALA (ALA, A):\n",
      "Base: ALA\n",
      " Properties: POLYMER PROTEIN CANONICAL_AA ALIPHATIC ALPHA_AA L_AA\n",
      " Variant types:\n",
      " Main-chain atoms:  N    CA   C  \n",
      " Backbone atoms:    N    CA   C    O    H  \n",
      " Side-chain atoms:  CB   CEN\n",
      "Atom Coordinates:\n",
      "   N  : 12.404, 7.64594, 3.32143e-16\n",
      "   CA : 13.862, 7.64594, 1.28484e-15\n",
      "   C  : 14.4129, 9.06611, 1.39319e-16\n",
      "   O  : 13.655, 10.0362, -1.38422e-15\n",
      "   CB : 14.3918, 6.8684, -1.196\n",
      "   CEN: 14.3919, 6.86928, -1.19534\n",
      "   H  : 11.9121, 8.52802, -3.16607e-16\n",
      "Mirrored relative to coordinates in ResidueType: FALSE\n",
      "\n"
     ]
    }
   ],
   "source": [
    "switch.apply(test_pose)\n",
    "print(test_pose.residue(5))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 237,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 238,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[0mcore.scoring.ScoreFunctionFactory: {0} \u001b[0mSCOREFUNCTION: \u001b[32mcen_std\u001b[0m\n",
      "20.25460263\n",
      "20.15966382\n",
      "19.55362599131596\n",
      "19.232434483424896\n",
      "18.979913887231877\n",
      "17.301794108241097\n",
      "16.941903435239702\n",
      "16.662825027174154\n",
      "16.124242762242204\n",
      "15.41213811288939\n",
      "14.868935623496704\n",
      "14.7198485177614\n",
      "14.4664380149136\n",
      "14.346618834011391\n",
      "12.734722504140853\n"
     ]
    }
   ],
   "source": [
    "#循环5000次，打分函数为scr=get_score_function(0)\n",
    "#随机某一个氨基酸\n",
    "#改变phi与psi\n",
    "#若打分低于上一个，接受；若高于，不接受\n",
    "scr=get_score_function(0)\n",
    "scr(test_pose)\n",
    "score_list=[scr(test_pose)]\n",
    "pose_list=[test_pose]\n",
    "for i in range(5000):\n",
    "    \n",
    "    a=random.randint(1,10)\n",
    "    tmp_pose=pose_list[-1]\n",
    "    x=tmp_pose.phi(a)\n",
    "    y=tmp_pose.psi(a)\n",
    "    \n",
    "    mean_num=(x+y)/2\n",
    "    new_x=random.gauss((x+y)/2,25)\n",
    "    new_y=random.gauss((x+y)/2,25)\n",
    "    \n",
    "    tmp_pose.set_phi(a, new_x)\n",
    "    tmp_pose.set_psi(a,new_x)\n",
    "    \n",
    "    fin_score=scr(tmp_pose)\n",
    "    \n",
    "    if scr(test_pose) < score_list[-1]:\n",
    "        score_list.append(scr(test_pose))\n",
    "        pose_list.append(test_pose)\n",
    "        print(scr(test_pose))\n",
    "        pmm.reinitialize_for_new_input()\n",
    "        pmm.apply(tmp_pose)\n",
    "        pmm.send_energy(tmp_pose)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 239,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'score')"
      ]
     },
     "execution_count": 239,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEGCAYAAABiq/5QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAT5ElEQVR4nO3df7DldX3f8ecrC5LFSFazlwQX2qUWnGmgcf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1T0Lq2RF9DyBNmLDsIjdV9T+7g7YvBDZU1d1DXtYvwJur6oZRDCqtle/4pf3dBJyT5IdgcI3Ubvt/ZlAM9n743tXa9iTZ3j3vqO6aCUvdALxxyfGBk5M8dQy/B+lJWdImLZPkXAYXankM2F1V/7y77sGXGTSO7u2edxLweww6/R9hcNWn7wL/papO6eqB/y3wKgbv/heA7VX18Lh/T9JSBr80hCQ/B5xdVb/U9yzSoXKNXzqAJL8D/AyDPnVp3fMdvyQ1xoO7ktQYg1+SGmPwS1JjDH5JaozBL0mN+f+R3uUErrCCzAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#画图，打分，接受的循环\n",
    "import matplotlib.pyplot as plt\n",
    "plt.scatter(score_list, range(len(pose_list)))\n",
    "plt.xlabel('cycle')\n",
    "plt.ylabel('score')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 241,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[0mcore.scoring.ScoreFunction: {0} \u001b[0m\n",
      "------------------------------------------------------------\n",
      " Scores                       Weight   Raw Score Wghtd.Score\n",
      "------------------------------------------------------------\n",
      " vdw                          1.000       2.495       2.495\n",
      " pair                         1.000       0.000       0.000\n",
      " env                          1.000      14.883      14.883\n",
      " cbeta                        1.000       3.981       3.981\n",
      "---------------------------------------------------\n",
      " Total weighted score:                       21.359\n"
     ]
    }
   ],
   "source": [
    "#展示打分最低的pose\n",
    "scr.show(pose_list[-1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 139,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "PDB file name: AAAAAAAA\n",
      "Total residues: 10\n",
      "Sequence: AAAAAAAAAA\n",
      "Fold tree:\n",
      "FOLD_TREE  EDGE 1 10 -1 \n"
     ]
    }
   ],
   "source": [
    "print(test_pose)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
